<?php

$this->widget('bootstrap.widgets.BootGridView', array(
        'id'=>'provider-grid',
        'summaryText'=>'',
        'dataProvider'=>$provider->search(),
        'emptyText'=>'Nincs még felvéve szolgáltató',
        'filter'=>$provider,
        'columns'=>array(
                array(
                        'name'=>'name',
                        'filter'=>CHtml::activeTextField($provider, 'name'),
                        'value'=>'$data->name',
                ),
                array(
                        'class'=>'bootstrap.widgets.BootButtonColumn',
                        'template' => '{prices}',
                        'buttons' => array(
                                'prices' => array(
                                        'visible'=>'checkAccess("ServicePrice.Update")',
                                        'url'=>'createUrl("servicePrice/index", array("providerId"=>$data->id, "blockId"=> '.$model->id.'))',
                                        'label'=> 'Díjak',
                                        'options'=>array(
                                                'class'=>'btn btn-success update'
                                        )
                                )
                        ),
                        'htmlOptions'=>array('style'=>'width: 50px'),
                ),
                array(
                        'class'=>'bootstrap.widgets.BootButtonColumn',
                        'template' => '{update} {delete}',
                        'buttons' => array(
                                'update' => array(
                                        'visible'=>'checkAccess("Provider.Update")',
                                        'url'=>'createUrl("provider/update", array("id"=>$data->id, "blockId"=> '.$model->id.'))',
                                        'label'=> 'Szerkeszt',
                                        'options'=>array(
                                                'class'=>'btn btn-info update'
                                        )
                                ),
                                'delete' => array(
                                        'visible'=>'checkAccess("Provider.Delete")',
                                        'url'=>'createUrl("provider/delete", array("id"=>$data->id, "blockId"=> '.$model->id. '))',
                                        'label'=> 'Töröl',
                                        'options'=>array(
                                                'class'=>'btn btn-inverse delete'
                                        )
                                ),

                        ),
                        'htmlOptions'=>array('style'=>'width: 125px'),
                ),


        )
));

    echo "<hr />";
    echo CHtml::link('Új szolgáltató', array('provider/create', 'blockId'=>$model->id), array('class'=>'btn btn-primary'));

